There are conventional techniques for moving a cursor (pointer) on the screen using an input device such as a stick, and specifying, with the cursor, a position in the virtual space displayed on the screen.
There are cases where only by simply moving the cursor in a direction specified with the input device, the user cannot comfortably perform the operation of moving the specified position (the position of the cursor).
Thus, the present specification discloses a storage medium storing an information processing program, an information processing device, an information processing system, and a method for calculating a specified position capable of improving the controllability in the operation of specifying a specified position.
(1)
An example storage medium is a computer-readable non-transitory storage medium storing an information processing program to be executed by a computer of an information processing device for calculating a specified position in a three-dimensional virtual space displayed on a screen of a display device. The information processing program causes the computer to execute: calculating an input position; and calculating the specified position.
The computer calculates a two-dimensional input position on the screen based on an input of a user.
The computer calculates, as the specified position, based on the input position, a three-dimensional position satisfying a distance condition regarding a distance from a predetermined reference position in the virtual space, wherein the three-dimensional position satisfies a range condition that an on-screen position corresponding to the three-dimensional position be within a range determined by an on-screen position corresponding to the reference position and the input position.
The term “on-screen position” as used herein refers to a position on the two-dimensional display screen, as opposed to the term “virtual-space position”, which as used herein refers to a position in a three-dimensional virtual space.
With configuration (1) above, since the specified position is calculated so that the distance condition is satisfied, it is possible to limit the range on the screen in which the specified position can be assumed. Thus, it is possible to improve the controllability in the operation of specifying the specified position. Since the specified position is calculated so that the range condition is satisfied, the specified position can be determined reflecting the input position of the user. This also improves the controllability in the operation of specifying the specified position.
(2)
The computer may calculate the specified position using, as the range condition, a condition that an on-screen position corresponding to the specified position be within a predetermined range between the on-screen position corresponding to the reference position and the input position.
With configuration (2) above, since the specified position is within the range between the reference position and the input position on the screen, the direction of the input position is generally equal to the direction of the specified position as seen from the reference position. Therefore, the user is unlikely to feel awkward even if the input position and the specified position are not the same position on the screen, and it is thus possible to provide a control method with a good controllability.
(3)
The specified position may calculate the specified position using, as the range condition, a condition that the on-screen position corresponding to the specified position be located on a line segment connecting between the on-screen position corresponding to the reference position and the input position.
With configuration (3) above, it is possible to easily calculate the specified position from the line segment. Moreover, the direction of the input position and the direction of the specified position as seen from the reference position can be made equal to each other, and it is thus possible to provide a control method with a good controllability.
(4)
The computer may calculate the specified position using, as the distance condition, a condition that the specified position be within a predetermined distance from the reference position in the virtual space.
With configuration (4) above, the range in which the specified position can be assumed can be easily limited to a range within a predetermined distance from the reference position.
(5)
The computer may calculate the specified position using, as the distance condition, a condition that a distance of the specified position regarding a predetermined plane in the virtual space be within a predetermined distance from the reference position.
With configuration (5) above, the specified position can be a position of which the distance is short with respect to a predetermined plane and is long with respect to a direction perpendicular to the predetermined plane, for example. Thus, with configuration (5) above, the range in which the specified position can be assumed can be set to an appropriate range for the application of the specified position by appropriately setting the predetermined plane.
(6)
The computer may calculate the specified position so that an on-screen position corresponding to the specified position is within a predetermined limit area on the screen.
With configuration (6) above, the range in which the specified position can be assumed can be limited by a method different from the method using the distance condition. Therefore, circumstances are less likely to occur where the specified position needs to be moved significantly, and it is thus possible to better improve the controllability in the operation of specifying the specified position.
(7)
The information processing device may obtain input information from a direction input device. The computer may calculate a new input position based on the input information so that the input position is obtained by moving a position of a lastly-calculated specified position on the screen in a direction represented by the input information. The computer may calculate a new specified position based on the new input position.
With configuration (7) above, the new input position is a position obtained by moving the previous specified position in an input direction specified by the user. Thus, it is possible to calculate the input position such that the position is easy to understand for the user.
(8)
The computer calculates one or more positions satisfying the range condition on the screen are calculated as candidate positions based on the input position. The computer determines a virtual-space position corresponding to one of the candidate positions satisfying the distance condition as the specified position.
With configuration (8) above, by calculating candidate positions and determining the range condition and the distance condition for the candidate positions, it is possible to easily calculate the specified position satisfying the range condition and the distance condition.
(9)
The computer may determine a virtual-space position corresponding to one of the candidate positions satisfying the distance condition that is farthest away from the reference position as the specified position.
With configuration (9) above, the specified position is one of the candidate positions that is closest to the input position. Then, since the difference between the direction specified by the user and the direction in which the specified position moves can be kept small, it is possible to provide a control method with a good controllability, with which the user is unlikely to feel awkward.
(10)
The computer may repeatedly calculate candidate positions until a predetermined condition is satisfied by using a binary search method on the reference position and the input position on the screen. Then, it may be determined whether the distance condition is satisfied each time a candidate position is calculated, and the specified position may be determined from the candidate positions satisfying the distance condition.
With configuration (10) above, by calculating the candidate positions using a binary search method, it is possible to efficiently determine candidate positions, and it is possible to efficiently perform the specified position calculation process.
(11)
The computer may determine, as the specified position, one of the three-dimensional positions satisfying the range condition that satisfies the distance condition and is in the vicinity of a position farthest away from the reference position in terms of a distance on the screen.
With configuration (11) above, the specified position is one of the positions satisfying the range condition and the distance condition that is closest to the input position on the screen. Then, since the difference between the direction specified by the user and the direction in which the specified position moves can be kept small, it is possible to provide a control method with a good controllability, with which the user is unlikely to feel awkward.
(12)
The computer may calculate the specified position by using, as the distance condition, a condition that an on-screen position corresponding to the specified position be within a predetermined area set with respect to the on-screen position corresponding to the reference position or that the specified position be within a predetermined distance from the reference position in the virtual space.
With configuration (12) above, for the range within the predetermined area, any position can be specified as the specified position, irrespective of the distance in the virtual space. Thus, it is possible to further improve the controllability in the operation of moving the specified position.
(13)
The computer may determine, as the specified position, one of positions in the virtual space that is displayed on the screen.
With configuration (13) above, the specified position is a position at which a straight line extending from the position of the viewpoint hits an object in the virtual space. Then, the specified position is a position displayed on the screen, and it is possible to display the specified position in an easy-to-understand manner for the user without the specified position being hidden by the object arranged in the virtual space.
Note that the present specification also discloses a information processing device and an information processing system for performing various processes equivalent to those realized by executing the information processing program in the configurations (1) to (13) above, and the present specification also discloses a method for calculating a specified position to be carried out in (1) to (13) above.
With the storage medium storing an information processing program, the information processing device, the information processing system and the method for calculating a specified position, the specified position is calculated so that the distance condition and the range condition are satisfied, thereby improving the controllability in the operation of specifying the specified position.
These and other objects, features, aspects and advantages will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.